package com.wanghlme.bookstore.exception;

/**
 * @author WangHailong
 */
public enum ErrorInfoEnum implements BaseErrorInfoInterface {

    /**
     * 状态码枚举
     */
    SUCCESS("200", "成功！"),
    BODY_NOT_MATCH("400", "请求的数据格式不符！"),
    SIGNATURE_NOT_MATCH("401", "请求的数字签名不匹配！"),
    NOT_FOUND("404", "未找到该资源！"),
    INTERNAL_SERVER_ERROR("500", "服务器内部错误！"),
    SERVER_BUSY("503", "服务器忙，请稍后重试！");

    private String resultCode;
    private String resultMsg;

    ErrorInfoEnum() {
    }

    ErrorInfoEnum(String code, String msg) {
        this.resultCode = code;
        this.resultMsg = msg;
    }

    /**
     * 获取错误码
     *
     * @return 错误码
     */
    @Override
    public String getResultCode() {
        return resultCode;
    }

    /**
     * 获取错误信息
     *
     * @return 错误信息
     */
    @Override
    public String getResultMsg() {
        return resultMsg;
    }
}
